package com.mwm.loyal.service.impl;

import com.mwm.loyal.bean.UserBean;
import com.mwm.loyal.dao.UserDao;
import com.mwm.loyal.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Resource(name = "userDao")
    private UserDao userDao;

    @Override
    public int register(UserBean bean) {
        System.out.println("AndroidService-register");
        return userDao.register(bean);
    }

    @Override
    public int destroy(UserBean deviceBean) {
        return userDao.destroy(deviceBean);
    }

    @Override
    public UserBean queryUser(String username) {
        return userDao.queryByUsername(username);
    }

    @Override
    public UserBean login(UserBean deviceBean) {
        System.out.println("AndroidService-login");
        return userDao.login(deviceBean);
    }

    @Override
    public UserBean getByUsername(String username) {
        return userDao.getByUsername(username);
    }

    @Override
    public int updateAccount(UserBean deviceBean) {
        return userDao.updateAccount(deviceBean);
    }

    @Override
    public int updatePassword(UserBean deviceBean) {
        return userDao.updatePassword(deviceBean);
    }

    @Override
    public UserBean queryLock(UserBean deviceBean) {
        return userDao.queryLock(deviceBean);
    }

    @Override
    public int updateLocked(UserBean deviceBean) {
        return userDao.updateLocked(deviceBean);
    }
}
